package qsl.utils;

public class ip {
	public static void main(String[] args){
		System.out.println(to("10.1.1.3"));
		System.out.println(from(50397450));
	}
	
	public static String from(long value)  
    {  
		return (value & 0xFF) + "." + ((value >> 8) & 0xFF) + "." + ((value >> 16) & 0xFF) + "." + ((value >> 24) & 0xFF);  
    }
	public static long to (String ip) {
		String[] ips = ip.split("\\.");
		return (Long.valueOf(ips[3]) << 24) | (Long.valueOf(ips[2]) << 16) | (Long.valueOf(ips[1]) << 8) | Long.valueOf(ips[0]); 
	}
}
